//
//  AreaViewController.m
//  10702
//
//  Created by student on 16/2/22.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "AreaViewController.h"
extern int calCount;
@interface AreaViewController ()

@end

@implementation AreaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)BackTap:(id)sender {
    [self.view endEditing:YES];
}
- (IBAction)calBtnPressed:(id)sender {
    float width = [self.WidthText.text floatValue];
    float length = [self.LengthText.text floatValue];
    float area1 = width * length;
    self.AreaText.text = [NSString stringWithFormat:@"%.2f",area1];
    
    float radius = [self.RadiusText.text floatValue];
    float area2 = M_PI * radius * radius;
    self.Area2Text.text = [NSString stringWithFormat:@"%.2f",area2];
    calCount++;
}

@end
